package com.eben.model;

import android.graphics.Canvas;
import android.graphics.Color;

public class InvinciblePoint extends GameObject {

	private static double activeTime;

	public InvinciblePoint(){
		this(0, 0, new Position(0,0), 10, Color.BLUE, 10);
	}
	
	/**
	 * Creates a fully customizable invinciblePoint
	 * @param velocity the speed of the invinciblePoint
	 * @param direction the direction of the invinciblePoint
	 * @param position the starting position of the invinciblePoint
	 * @param radius the radius of the invinciblePoint
	 * @param color the color of the invinciblePoint
	 * @param activeTime how long time the invinciblePoint stays active
	 */
	public InvinciblePoint(double velocity, double direction, Position position, int radius, int color, int activeTime){
		super(velocity, direction, position, radius, color);
		this.setActiveTime(activeTime);
		paint.setColor(color);
	}
	/**
	 * Creates a invinciblePoint with 0 velocity and 0 direction.
	 * @param position the starting position
	 * @param radius the radius of the invinciblePoint
	 * @param color the color of the invinciblePoint
	 * @param activeTime how long time the invinciblePoint stays active
	 */
	public InvinciblePoint(Position position, int radius, int color, int activeTime){
		this(0, 0, position, radius, color, activeTime);
	}
	
	/**
	 * Creates a invinciblePoint with 0 velocity and 0 direction with standard radius, color and health.
	 * @param position the starting position of the invinciblePoint.
	 */
	public InvinciblePoint(Position position) {
		this(0, 0, position, 5, Color.BLUE, 5);
	}
	
	@Override
	public void draw(Canvas canvas) {
		canvas.drawCircle((float)position.getX(), (float)position.getY(), radius, paint);
	}

	@Override
	public void updatePosition() {
		//Does nothing because an invinciblePoint is still at the moment.
	}
	
	/**
	 * Sets the time that the invincible mode remains active.
	 * @param activeTime the time that the invincible mode remains active.
	 */
	public void setActiveTime(int activeTime) {
		InvinciblePoint.activeTime = activeTime;
	}
	
	/**
	 * Returns the time that the invincible mode is active when you collect an InvinciblePoint.
	 * @return activeTime the time that the mode remains active.
	 */
	public static double getActiveTime() {
		return activeTime;
	}
}